package org.whatever.aha.zjut.platform.service.project;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.whatever.aha.zjut.platform.entity.project.ProjectMemberApply;
import org.whatever.aha.zjut.platform.mapper.project.ProjectMemberApplyMapper;

/**
 * @author Vc
 * @version 1.0
 * @Desc
 * @date 2021/09/15 0:03
 */
@RequiredArgsConstructor
@Service
public class ProjectMemberApplyService {
    final ProjectMemberApplyMapper projectMemberApplyMapper;

    /**
     * 根据项目ID删除申请信息
     */
    @Transactional(rollbackFor = Exception.class, propagation= Propagation.REQUIRED)
    public int deleteProjectMemberApply(int projectId) {
        return projectMemberApplyMapper.delete(new QueryWrapper<ProjectMemberApply>().eq("project_id",projectId));
    }
}
